<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>SortStructuredList</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">SortStructuredList()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>SortStructuredList</b></font>(ListName(), Options, OffsetOf(Structure\Field), TypeOf(Structure\Field) [, Start, End])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>





Sorts the specified structured <a href="../list/index.html">list</a>, according to the given options. 
The list must have an associated <a href="../reference/structures.html">structure</a>. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>ListName()</i></td>
<td width="90%"> 
 
The list to sort. 

 

</td></tr>
<tr><td><i>Options</i></td>
<td> 
可以是下列值的组合︰ 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Sort_Ascending</font> : Sort the list in ascending order (lower values first)
  <font color="#924B72">#PB_Sort_Descending</font>: Sort the list in descending order (higher values first)
  <font color="#924B72">#PB_Sort_NoCase</font>    : Sort the string list without case sensitive (a=A, b=B etc..)
</font></pre>

</td></tr>
<tr><td><i>OffsetOf(Structure\Field)</i></td>
<td> 
 
Offset of the field in the structure. 
<a href="../reference/compilerfunctions.html">OffsetOf()</a> may be used to retrieve the field offset in the structure associated to the list. 

 

</td></tr>
<tr><td><i>TypeOf(Structure\Field)</i></td>
<td> 
 
The field type of the field in the structure. It has to match the real structure field type. 
<a href="../reference/compilerfunctions.html">TypeOf()</a> may be used to automatically retrieve the field type. 
Available types are: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Byte</font>     : The structure field to sort is a byte (.b)
  <font color="#924B72">#PB_Word</font>     : The structure field to sort is a word (.w)
  <font color="#924B72">#PB_Long</font>     : The structure field to sort is a long (.l)
  <font color="#924B72">#PB_String</font>   : The structure field to sort is a string (.s or $, fixed strings are not supported)
  <font color="#924B72">#PB_Float</font>    : The structure field to sort is a float (.f)
  <font color="#924B72">#PB_Double</font>   : The structure field to sort is a double (.d)
  <font color="#924B72">#PB_Quad</font>     : The structure field to sort is a quad (.q)
  <font color="#924B72">#PB_Character</font>: The structure field to sort is a character (.c)
  <font color="#924B72">#PB_Integer</font>  : The structure field to sort is an integer (.i)
  <font color="#924B72">#PB_Ascii</font>    : The structure field to sort is an ascii character (.a)
  <font color="#924B72">#PB_Unicode</font>  : The structure field to sort is a unicode character (.u)
</font></pre>

</td></tr>
<tr><td><i>Start, End (optional)</i></td>
<td> 
 
The index of the first and last element in the list that should be sorted. If these parameters 
are not specified, then the whole list is sorted. 

 

</td></tr>
</table>
</blockquote><p><b>备注</b></p><blockquote>

<a href="../reference/variables.html">Fixed strings</a> are not supported by the sort routine. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">
  <b><font color="#3A3966">Structure</font></b> Animal
    Name$
    Speed.l
  <b><font color="#3A3966">EndStructure</font></b>

  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Animals</font>.Animal()

<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Animals</font>())
<font color="#3A3966">  Animals</font>()\Name$ = "Tiger"
<font color="#3A3966">  Animals</font>()\Speed = 10

<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Animals</font>())
<font color="#3A3966">  Animals</font>()\Name$ = "Jaguar"
<font color="#3A3966">  Animals</font>()\Speed = 40

<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Animals</font>())
<font color="#3A3966">  Animals</font>()\Name$ = "Zebra"
<font color="#3A3966">  Animals</font>()\Speed = 30

<font color="#3A3966">  SortStructuredList</font>(<font color="#3A3966">Animals</font>(), 0,<font color="#3A3966"> OffsetOf</font>(Animal\Name$),<font color="#3A3966"> TypeOf</font>(Animal\Name$))

  <b><font color="#3A3966">ForEach</font></b> <font color="#3A3966">Animals</font>()
    <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">Animals</font>()\Name$+" - Speed: "+<font color="#3A3966">Str</font>(<font color="#3A3966">Animals</font>()\Speed)
  <b><font color="#3A3966">Next</font></b>

<font color="#3A3966">  SortStructuredList</font>(<font color="#3A3966">Animals</font>(), 0,<font color="#3A3966"> OffsetOf</font>(Animal\Speed),<font color="#3A3966"> TypeOf</font>(Animal\Speed))

  <b><font color="#3A3966">ForEach</font></b> <font color="#3A3966">Animals</font>()
    <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">Animals</font>()\Name$+" - Speed: "+<font color="#3A3966">Str</font>(<font color="#3A3966">Animals</font>()\Speed)
  <b><font color="#3A3966">Next</font></b>

</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="sortlist.html">SortList()</a>, <a href="randomizelist.html">RandomizeList()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=sortstructuredarray.html>SortStructuredArray()</a> - <a href="index.html">Sort Index</a><br><br>

</body></html>